﻿<UserControl x:Class="Patterns4Net.ArchitectureExplorer.Views.PatternDocumentationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Utils="clr-namespace:Patterns4Net.ArchitectureExplorer.Views.Utils" mc:Ignorable="d" 
             d:DesignHeight="624" d:DesignWidth="300">
    <UserControl.Resources>
        <Utils:EmptyOrNullToVisibilityConverter x:Key="EmptyOrNullToVisibilityConverter"/>
    </UserControl.Resources>
    
    <StackPanel Margin="10, 5, 5, 5">
        <TextBlock FontSize="20" Text="{Binding Title}"/>

        <StackPanel Visibility="{Binding Methods, Converter={StaticResource EmptyOrNullToVisibilityConverter}}">
            <TextBlock FontStyle="Italic" FontSize="12" TextWrapping="Wrap">
                This pattern is method specific and is implemented by following methods: 
            </TextBlock>
            <ItemsControl ItemsSource="{Binding Methods}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Margin="17, 0, 0, 0" Text="{Binding Name}" FontSize="15"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </StackPanel>
        
        <ContentPresenter Margin="0, 5, 0, 0" Content="{Binding Path=Documentation}"/>         
    </StackPanel>
</UserControl>
